﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Import Namespace="Tencent.OA.ACM.Entity" %>
<%@ Import Namespace="Tencent.OA.ACM.App" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>ViewPhoto</title>
       <link href="<%= this.Url.Content("~/content/Global.css") %>" rel="Stylesheet" type="text/css" />
    <link href="<%= this.Url.Content("~/content/Site.css") %>" rel="Stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript" src="<%=this.Url.Content("~/content/scripts/jquery-1.4.2.js") %>"></script>
   <%-- <script src="<%=this.Url.Content("~/content/Scripts/jquery.form.js")%>" type="text/javascript"></script>--%>    
</head>
<body style="width: 675px;" frame-border=0px;>
 

    <%=this.Html.Hidden("stationID", ViewData["stationID"])%>
    <div id="photoView">
        <%--<iframe frameborder="0">--%>
        <div id="dv_photo_frame" class="dv_photo_frame" style="height:320px;">            
           <%-- <div class="attatch_img_item">                
               
            </div>--%>
            <div class="clear"></div>
        </div>     
        <%--</iframe>--%>
    </div>

</body>
<script type="text/javascript" language="javascript">
    // 全局根路径   
    var dircache = '<%=this.Url.Content("~/caches/") %>';
    var photoUrl='<%=this.Url.Content("~/Home/GetPictureThumb?width=130&height=100&")%>';
    var photoOriginalUrl='<%=this.Url.Content("~/Home/GetOriginalPicture?id=") %>';
    var jsUrl='<%=this.Url.Content("~/caches/atta_img/"+ViewData["stationID"]+".js") %>';
    
    var ATTATCH_IMG=[];
    $(document).ready(function() {
        loadJs();
        loadAttatchment();
    });
    function loadJs() {
         var rtjs = $.ajax({
                url: jsUrl+"?rd="+Math.random(),
                async: false,
                dataType: "json"
            }).responseText;
            try {
                ATTATCH_IMG = eval(rtjs);
            } catch (ex) { ATTATCH_IMG = []; }
    }
    function loadAttatchment() {
        if (typeof (ATTATCH_IMG) != 'undefined') {
            var photoContainer = $("#dv_photo_frame");
            $.each(ATTATCH_IMG, function(n, o) {
            var html = '<div class="attatch_img_item"><a href="' + photoOriginalUrl + o.attaId + '" target="_blank"> '
                          + '<img width="130" height="100" src="' + photoUrl
                          +'fileName='+o.attaId+o.pf
                          +'&contentType='+o.ct
                          + '" /><div class="dv_photo_desc" title="' + o.attaName + '">' + o.attaName + '</div>'
                          + '</a></div>';
                photoContainer.append(html);
            });
            if (ATTATCH_IMG.length == 0) {
                photoContainer.append("未上传任何站点照片。");
            }
        }
    }
    </script>
</html>
